//
//  MYGFindSendMessageView.swift
//  MYGrow
//
//  Created by 小火科技 on 2024/3/19.
//

import UIKit

class MYGFindSendMessageView: UIView {
    // MARK: - init
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        configUI()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    // MARK: - UI
    private func configUI() {
        backgroundColor = .white
        addSubview(imageView)
        addSubview(nameLabel)
        addSubview(hintLabel)
        addSubview(rightImageView)
        addSubviews([topLineView, bottomLineView])
        
        imageView.snp.makeConstraints { make in
            make.left.equalToSuperview().offset(18)
            make.centerY.equalToSuperview()
        }
        
        nameLabel.snp.makeConstraints { make in
            make.left.equalTo(imageView.snp.right).offset(17)
            make.centerY.equalToSuperview()
        }
        
        hintLabel.snp.makeConstraints { make in
            make.right.equalTo(rightImageView.snp.left).offset(-11)
            make.centerY.equalToSuperview()
        }
        
        rightImageView.snp.makeConstraints { make in
            make.right.equalToSuperview().inset(26)
            make.centerY.equalToSuperview()
        }
        
        topLineView.snp.makeConstraints { make in
            make.left.right.equalToSuperview().inset(19)
            make.top.equalToSuperview()
            make.height.equalTo(0.5)
        }
        
        bottomLineView.snp.makeConstraints { make in
            make.left.right.equalToSuperview().inset(19)
            make.bottom.equalToSuperview()
            make.height.equalTo(0.5)
        }
    }
    // MARK: - lazy load
    private(set) lazy var imageView: UIImageView = {
        let imgV = UIImageView()
        return imgV
    }()
    
    private(set) lazy var nameLabel: UILabel = {
        let label = UILabel()
        label.font = .regular(15)
        label.textColor = .rgba(54, 54, 54, 1)
        return label
    }()
    
    private(set) lazy var hintLabel: UILabel = {
        let label = UILabel()
        label.font = .regular(15)
        label.textColor = .rgba(54, 54, 54, 1)
        return label
    }()
    
    private lazy var rightImageView: UIImageView = {
        let imgV = UIImageView(image: UIImage(named: "Find/right"))
        return imgV
    }()
    
    private(set) lazy var topLineView: UIView = {
        let view = UIView()
        view.backgroundColor = .rgba(238, 238, 238, 1)
        return view
    }()
    
    private(set) lazy var bottomLineView: UIView = {
        let view = UIView()
        view.backgroundColor = .rgba(238, 238, 238, 1)
        return view
    }()
}
